package com.xxp.mapper;

import com.xxp.controller.request.AdminPageRequest;
import com.xxp.controller.request.LoginRequest;
import com.xxp.controller.request.PassRequest;
import com.xxp.controller.request.UserPageRequest;
import com.xxp.entity.Admin;
import com.xxp.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AdminMapper {

    List<Admin> list();
    /**
     * 分页查询
     */
    List<Admin> listByCondition(AdminPageRequest adminPageRequest);

    /**
     * 新增
     */
    void save(Admin admin);



    /**
     * 根据ID查询
     * @param id
     */
    Admin getById(Integer id);
    /**
     * 根据ID修改
     */
    void update(Admin admin);

    /**
     * 根据ID删除
     * @param id
     */
    void deleteById(Integer id);
    /**
     * 登录
     */
    Admin getByUsernameAndPassword(@Param("username") String username,@Param("password") String password);

    /**
     * 修改密码
     */
    int updatePassword(PassRequest passRequest);

    Admin findByUsername(String Username);

    /**
     * 根据ID修改密码
     */
    int updatePasswordById(PassRequest passRequest);
}
